<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@include file="/taglibs.jsp"%>
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">  
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <link href="${ctx}/resources/semanticui/semantic.min.css" rel="stylesheet" type="text/css" />
    <link href="${ctx}/resources/apps.css" rel="stylesheet" type="text/css" />
    <title>MedTrend医趋势--${job.name} - ${job.reward}</title>  
</head>
<body>
<div class="ui segment" id="n-page">
&nbsp;<br>
<c:choose>
    <c:when test="${job != null}">
        <h3 class="ui attached header" id="list-title">职位信息</h3>
        &nbsp;<br>
        职位推荐奖金：<font color="red">${job.reward}</font>元<br>
        职位名称：${job.name}<br>
        职位编号：${job.jobCode}<br>
        公司：${job.companyName}<br>
        工作地点：${job.city.name}<br>
        负责区域：${job.location}<br>
        下属人数：${job.employeeNum}<br> 
        主要职责：${job.majorDuty}<br>
        职位描述：${position.description}<br>
        有效期：${job.expiredDateStr }&nbsp;<br>&nbsp;<br>
        期望公司来源1：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>
期望公司来源2：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid2 == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>
期望公司来源3：
<c:forEach items="${companies}" var="company">  
    <c:choose>
        <c:when test="${job.expectcompanyid3 == company.id }">
            ${company.name}
        </c:when> 
    </c:choose>  
</c:forEach>
<br>&nbsp;<br>

        <c:if test="${openid != null}">
            <c:choose> 
                <c:when test="${emp != null}">
                    <div class="ui center aligned segment" id="choice-buttons"> 
                        <div class="two ui buttons"> 
                            <div class="ui button active dog" id="other">我要推荐</div> 
                            <div class="ui button dog" id="myself">我要自荐</div> 
                        </div>
                    </div>
                </c:when>
                <c:otherwise>
                    您需要填写直通车信息后，才能开始推荐/自荐职位<br>&nbsp;<br>
                    <div class="ui segment" id="cont-next">
                        <div class="fluid ui button" id="info">填写直通车</div>
                    </div>

                </c:otherwise>
            </c:choose>
        </c:if>
    </c:when>
    <c:otherwise>
        ${msg}
        <br />
    </c:otherwise>
</c:choose>

<c:if test="${openid == null}">
    <h3 class="ui attached header" id="list-title">
        关于“MedTrend医趋势”
    </h3>
    &nbsp;<br>
    “MedTrend医趋势”是国内领先的医疗行业职位推荐平台。通过为我们推荐合适的候选人(包括您自己)，你可以获得推荐奖金。<br>&nbsp;<br>

    您需要<b>关注“MedTrend医趋势”</b>微信服务号，才能使用“MedTrend医趋势”为您提供的求职/推荐服务。&nbsp;<br>&nbsp;<br>

    <h3 class="ui attached header" id="list-title">
        关注“MedTrend医趋势”
    </h3>
    &nbsp;<br>
    1、你可以通过搜索“MedTrend医趋势”，关注我们的微信服务。或者&nbsp;<br>&nbsp;<br>
    2、长按下面的二维码图片，选择“识别图中二维码”，关注“MedTrend医趋势”微信服务。

    <div class="ui segment" id="qrcode">
        <div class="ui small image">
            <img src="${ctx}/resources/images/qrcode.jpg">
        </div>
    </div>
</c:if>


</div>

<script src="${ctx}/resources/semanticui/jquery-2.1.4.min.js"></script>
<script src="${ctx}/resources/semanticui/semantic.js" type="text/javascript"></script>
<script type="text/javascript">
    var handler = { 
        activate: function() { 
            $(this).addClass('active').siblings().removeClass('active');
            if($(this).attr('id') == 'other') {
                location.href = '${ctx}/wechat/candidate/recommend/toRecommend.do?jobId='+${job.id};
            }
            if($(this).attr('id') == 'myself') {
                location.href = '${ctx}/wechat/candidate/assistant/toRecommend.do?jobId='+${job.id};
            }
            if($(this).attr('id') == 'info') {
                location.href = '${ctx}/wechat/candidate/main.page';
            }
        } 
    };

    $(document).ready(function() { 
        $('.button').on('click', handler.activate);
    });

</script>
</body>
</html>